]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
layout: Drop fallback for hot corner without barriers
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 23 Dec 2025 14:09:09 +0000 (15:09 +0100)
committerMarge Bot <marge-bot@gnome.org>
Mon, 12 Jan 2026 11:55:51 +0000 (11:55 +0000)
The BARRIER backend capability was been moot for a long time since
XInput 2.4 became widespread and barriers became commonplace. And
even further recently with the removal of the X11 backend. The
native backend has always implemented barriers.

It seems we can drop this fallback handling. Since the _entered flag
was only used in those paths, the leave event vfunc is unnecessary too.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4016>

js/ui/layout.js

index d415e595de48f1de4393926d5b7983a8eee57cb0..e68780d0e58067173ef0ee747ccb49f2a9138471 100644 (file)
@@ -1144,19 +1144,11 @@ class HotCorner extends Clutter.Actor {
     _init(layoutManager, monitor, x, y) {
         super._init();
 
-        // We use this flag to mark the case where the user has entered the
-        // hot corner and has not left both the hot corner and a surrounding
-        // guard area (the "environs"). This avoids triggering the hot corner
-        // multiple times due to an accidental jitter.
-        this._entered = false;
-
         this._monitor = monitor;
 
         this._x = x;
         this._y = y;
 
-        this._setupFallbackCornerIfNeeded(layoutManager);
-
         this._pressureBarrier = new PressureBarrier(
             HOT_CORNER_PRESSURE_THRESHOLD,
             HOT_CORNER_PRESSURE_TIMEOUT,
@@ -1219,45 +1211,6 @@ class HotCorner extends Clutter.Actor {
         }
     }
 
-    _setupFallbackCornerIfNeeded(layoutManager) {
-        const {capabilities} = global.backend;
-        if ((capabilities & Meta.BackendCapabilities.BARRIERS) === 0) {
-            this.set({
-                name: 'hot-corner-environs',
-                x: this._x,
-                y: this._y,
-                width: 3,
-                height: 3,
-                reactive: true,
-            });
-
-            this._corner = new Clutter.Actor({
-                name: 'hot-corner',
-                width: 1,
-                height: 1,
-                opacity: 0,
-                reactive: true,
-            });
-            this._corner._delegate = this;
-
-            this.add_child(this._corner);
-            layoutManager.addChrome(this);
-
-            if (Clutter.get_default_text_direction() === Clutter.TextDirection.RTL) {
-                this._corner.set_position(this.width - this._corner.width, 0);
-                this.set_pivot_point(1.0, 0.0);
-                this.translation_x = -this.width;
-            } else {
-                this._corner.set_position(0, 0);
-            }
-
-            this._corner.connect('enter-event',
-                this._onCornerEntered.bind(this));
-            this._corner.connect('leave-event',
-                this._onCornerLeft.bind(this));
-        }
-    }
-
     _onDestroy() {
         this.setBarrierSize(0);
         this._pressureBarrier.destroy();
@@ -1285,27 +1238,6 @@ class HotCorner extends Clutter.Actor {
 
         return DND.DragMotionResult.CONTINUE;
     }
-
-    _onCornerEntered() {
-        if (!this._entered) {
-            this._entered = true;
-            this._toggleOverview();
-        }
-        return Clutter.EVENT_PROPAGATE;
-    }
-
-    _onCornerLeft(actor, event) {
-        if (event.get_related() !== this)
-            this._entered = false;
-        // Consume event, otherwise this will confuse onEnvironsLeft
-        return Clutter.EVENT_STOP;
-    }
-
-    vfunc_leave_event(event) {
-        if (event.get_related() !== this._corner)
-            this._entered = false;
-        return Clutter.EVENT_PROPAGATE;
-    }
 });
 
 export class PressureBarrier extends Signals.EventEmitter {